/*
 * uefi.h
 *
 * UEFI common header.
 */

#ifndef __UEFI_H__
#define __UEFI_H__

#include <efi.h>

#include <efi-bs.h>
#include <efi-ct.h>
#include <efi-rs.h>
#include <efi-st.h>
#include <efi-time.h>
#include <protocol/efi-acpitp.h>
#include <protocol/efi-dpp.h>
#include <protocol/efi-fp.h>
#include <protocol/efi-gop.h>
#include <protocol/efi-lidpp.h>
#include <protocol/efi-lip.h>
#include <protocol/efi-sfsp.h>
#include <protocol/efi-sio.h>
#include <protocol/efi-stip.h>
#include <protocol/efi-stop.h>
#include <protocol/efi-vmpp.h>

typedef UINTN RETURN_STATUS;
#define RETURN_ERROR(StatusCode) (((INTN)(RETURN_STATUS)(StatusCode)) < 0)
#define EFI_ERROR(A) RETURN_ERROR(A)

#ifndef IN
#define IN
#define OUT
#define OPTIONAL
#endif

// Forces EFI calling conventions reguardless of compiler options
#ifndef EFIAPI
#ifdef _MSC_EXTENSIONS
// Force C calling convention for Microsoft C compiler
#define EFIAPI __cdecl
#elif defined(HAVE_USE_MS_ABI)
// Force amd64/ms calling conventions.
#define EFIAPI __attribute__((ms_abi))
#else
// Substitute expresion to force C calling convention
#define EFIAPI
#endif
#endif

#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif

#define __bool_true_false_are_defined 1
#ifndef __cplusplus
#define bool _Bool
#define false 0
#define true 1
#endif 

#endif /* __UEFI_H__ */
